package com.qubuyer.core.app

import android.os.Bundle
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding

/**
 * Author: linwg
 * Time: 2020/11/2 0002
 * Description:
 */
abstract class DataBindingActivity<V : ViewDataBinding> : BaseActivity() {

    protected lateinit var dataBinding: V

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        dataBinding = DataBindingUtil.setContentView<V>(this, layoutId)
        dataBinding.lifecycleOwner = this
        onDataBind(dataBinding)
    }

    abstract fun onDataBind(dataBinding: V)
}